<script type="text/javascript" src="<?php echo base_url()?>js/admins/jquery-latest.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/admins/jquery.tablesorter.js"></script>
<script type="text/javascript">
	$(function() {		
		$("#myTable").tablesorter({sortList:[[0,0],[2,1]]});
	});	
</script>
<div id="content-right">
	<div id="add-product">
		<div id="sidebar-list" class="black">
			<div id="img-product" class="left white">
				 <?php echo $title?>
			</div>
			<div id="img-back" class="right">
				<a href="javascript:;" onclick="history.go(-1)" class="white">Quay lại trang trước </a>
			</div>
			<div class="clear"></div>
		</div>
		<div id="src-product" style="height:auto;">
			<form action="<?php echo base_url()?>admins/admin_log/search" method="post" onSubmit="return checkNull(this,'Bạn chưa nhập thông tin cần tìm');">
				<div style="float:left;">
					<div style="float:left;">
						<label class="black">User Admin </label>
						<select id="user_admin" name="user_admin" class="selectText">
							<option value="" selected="selected">Chọn User</option>
							<?php foreach ($admin_admin as $admin) {?>
								<option value="<?php echo $admin['id']?>" <?php if(!empty($_SESSION['user_admin'])){if($_SESSION['user_admin']==$admin['id']) echo 'selected="selected"';}?>><?php echo $admin['username']?></option>
							<?php }?>
						</select>
					</div>					
				</div>								
				<div><input type="submit" class="submit-src" name="cmd" value=' ' /></div>
			</form>	
		</div>
		<?php if (isset($_SESSION["permiss_error"]) && !empty($_SESSION["permiss_error"])){?>
			<div class="form-add" align="center" style="padding-bottom:15px;">
				<?php echo '<font style="color:red; text-align:center; font-size:15px;">'.$_SESSION['permiss_error'].'</font>'?>
			</div>
        <?php }$_SESSION["permiss_error"] = NULL;?>
		<form name="myform" id="myform" action="<?php echo base_url() ?>admins/admin_log/delete" method="POST" onSubmit="return checkInput(this,'Bạn hãy chọn ít nhất một menu','Bạn có chắc muốn xóa không?');">
			<input type="hidden" id="chon" name="chon">
			<div id="select-product">
				<ul class="left">
					<li><a href="#"><span id="chk">0</span> đã chọn </a>&nbsp; |</li>
					<li><input style="background-color: none; border: none; text-decoration: underline; color: #EF3503; font-family: Arial; cursor: pointer;" type="submit" name="cmd" value="Delete" class="buttonDel">&nbsp; |</li>
					<li><input style="background-color: none; border: none; text-decoration: underline; color: #EF3503; font-family: Arial; cursor: pointer;" type="submit" name="cmdall" value="Delete All" class="buttonDel"></li>
					<li></li>
				</ul>
				<div class='clear'></div>
			</div>
			<div id="list-product">
				<table id="myTable" class="tablePr tablesorter" width="100%" border="0" cellspacing="0" cellpadding="0">
					<thead>
						<tr class="headerTbl">
							<td width="3%">STT</td>
							<td width="3%"><input id="checkall" type="checkbox" name="chkall" value="yes" onClick="docheck(this.form,0);" /></td>
							<th width="50%">Hành Động</th>
							<th width="10%">Admin</th>
							<th width="7%">IP</th>
							<th width="10%">Thời Gian</th>
						</tr>
					</thead>
					<?php if (!empty($admin_log)){?>
						<tbody>
							<?php
								$i = 1; 
								foreach ($admin_log as $menu) {
									if ($i % 2 == 0)
									{
										$bgcolor	= 'str1';
									}
									else
									{
										$bgcolor	= 'str2';
									}
							?>
							<tr class="<?php echo $bgcolor?>">
								<td><?php echo $i;?></td>
								<td><input type="checkbox" name="Xoa" value="<?php echo $menu['id']?>" onClick="docheckone(this.form);"/></td>
								<td style="text-align: left;"><?php echo $menu['action']?></td>
								<td><?php echo $menu['username']?></td>
								<td><?php echo $menu['ip']?></td>
								<td><?php echo date('d/m/Y H:i:s', $menu['time'])?></td>
							</tr>
							<?php $i++;}?>
						</tbody>
					<?php }else{?>
						<tr><td colspan="6" style="padding:15px;">Không có dữ liệu</td></tr>
					<?php }?>
				</table>
			</div>
		</form>
		<div id="pagingPr"><?php echo $paging?></div> 
	</div>
</div><!-- end  content-right -->	